package com.itboye.eweilisten.util.widget;

import com.itboye.eweilisten.app.MyApplication;
import com.itboye.eweilisten.util.loadingutil.MAlert;
import com.itboye.eweilisten.util.sputil.Const;
import com.itboye.eweilisten.util.sputil.SPUtils;
import com.itboye.eweilisten.volley.ResultEntity;

/**
 * Created by itboye on 2017/3/17.
 * 缓存数据
 *
 */

public class IsStringSPUtils {
    /**
     * 返回用户ID
     * @return
     */
    public static String IsUid(){
        String uid= (String) SPUtils.get(MyApplication.instance, null,
                Const.ID, "");
        return uid;
    }

    /**
     * 返回用户账号
     * @return
     */
    public static String getUserName(){
        String userNmae=(String) SPUtils.get(MyApplication.instance, null,
                Const.USERNAME, "");
        return userNmae;
    }
    public static String getSid(){
        String sId=(String) SPUtils.get(MyApplication.instance, null,
                Const.S_ID, "");
        return sId;
    }

    public static void tianjia(ResultEntity entity){
        if (!entity.getCode().equals("0")) {
            if(entity.getCode().equals("1111")){
                MAlert.alert(entity.getMsg());
                return;
            }
            MAlert.alert(entity.getMsg());
            return;
        }
    }

}
